home *** CD-ROM | disk | FTP | other *** search
- Path: airdmhor.gen.nz!not-for-mail
- From: gumboot@airdmhor.gen.nz (Simon Hosie)
- Newsgroups: comp.lang.c
- Subject: Re: What's better & why
- Date: 27 Feb 1996 01:45:20 +1300
- Organization: Airdmhor : a couple of BBS's, a bunch of people, and a cat.
- Message-ID: <4gsa10$qn6@airdmhor.gen.nz>
- References: <31297C5A.E6C@connix.com> <4gf4s6$fl0@kannews.ca.newbridge.com> <4gigbe$t4m@news.microsoft.com>
- NNTP-Posting-Host: airdmhor.gen.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- Dann Corbit:
- > 90% of the time, it is better to make code clear and understandable than
- > to tweak out a couple extra cycles. Using a profiler, identify the hot
- > spots in your code that need speed, and tweak them. Often, cranking
- > up the optimization level does a pretty good job of optimizing for us.
-
- So, you could get both readability and efficiency by assigning the
- variable to the more likely option and if (something special happens) then
- assign the other value.
-
- Or am I the only one that reads if()'s as the thing less likely to happen?
-